<template>
	<view class="store-index-item" @click="jump(odd.id)">
		<view class="item-img">
			<image :class="{filterImg : filterFlag}" :src="odd.thumb_img" mode="aspectFill"></image>
			<view class="img-label">{{odd.storeType}}</view>
			<view class="img-mask" v-if="!odd.isOpen">
				<image src="../../static/index-time.png" mode="aspectFill"></image>
				<view>即将开放</view>
			</view>
		</view>
		<view class="item-content">
			<view class="store-name word-line-clamp1">{{odd.name}}</view>
			<view class="store-content word-line-clamp3">
				<block v-for="(tag,index) in odd.tags" :key='index'>
					<text>{{tag}}</text> 
					<text v-if="index+1!==odd.tags.length">·</text>
				</block>
			</view>
			
			<view class="store-bottom">
				<view class="store-describe">{{odd.describe}}</view>
				<view class="store-distance">
					<text>{{odd.appointmentCount}}人已预约</text>
					<text style="color: #EFEFEF;margin: 0 16rpx;">|</text>
					<image src="../../static/index/distance.png" mode="aspectFill"></image>
					<text>{{odd.distance}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"store-item",
		data() {
			return {
				
			};
		},
		props:{
			odd:Object
		},
		methods:{
			jump(id) {
				this.$emit('jumpDetil',id);
			}
		}
	}
</script>

<style lang="scss">

	.store-index-item {
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		margin-bottom: 20rpx;
		display: flex;
	}
	.item-img {
		width: 210rpx;
		height: 210rpx;
		margin-right: 20rpx;
		border-radius: 12rpx;
		position: relative;
		
		.img-mask {
			width: 100%;height: 100%;border-radius: 12rpx;
			position: absolute;top: 0;left: 0;
			background: rgba(0,0,0,0.45);
			
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			text-align: center;
			
			font-size: 24rpx;
			font-weight: bold;
			color: #FFFFFF;
			
			image {
				width: 58rpx;height: 58rpx;
			}
		}
		
		image {
			display: block;
			width: 210rpx;
			height: 210rpx;
			border-radius: 12rpx;
		}
		
		.img-label {
			position: absolute;
			height: 30rpx;
			padding: 0 8rpx;
			border-radius: 4rpx;line-height: 30rpx;
			background: rgba(0, 0, 0, 0.5);
			font-size: 20rpx;color: #FFFFFF;text-align: center;
			position: absolute;bottom: 10rpx;right: 14rpx;
		}
	}
	
	.item-content {
		width: 440rpx;
		position: relative;
	}
	.store-name {
		font-size: 32rpx;
		font-weight: bold;
		color: #141414;
		margin-bottom: 10rpx;
	}
	
	.store-content {
		font-size: 24rpx;
		color: #666666;
	}
	
	.store-bottom {
		width: 100%;
		position: absolute;bottom: 0;
		display: flex;
		justify-content: space-between;
		
		image {
			width: 22rpx;
			height: 22rpx;
		}
		.store-describe {
			font-size: 24rpx;
			color: #FF4D4F;
		}
		.store-distance {
			font-size: 20rpx;
			display: flex;
			align-items: center;
			color: #999999;
		}
	}
	
</style>